<template>
  <div class="add-node-btn">
    <a-button @click="click" type="primary" shape="circle" icon="plus" />
    <AddNodeDialog
      :dialog.sync="dialog"
      :node="node"
      @addnode="addnode"
    />
  </div>
</template>
<script>
import AddNodeDialog from './add-node-dialog'
export default {
  name: 'AddNodeBtn',
  components: {
    AddNodeDialog
  },
  props: {
    node: {
      type: Object,
      default: undefined
    }
  },
  data: () => ({
    dialog: false
  }),
  methods: {
    click () {
      this.dialog = true
    },
    addnode (node) {
      this.$emit('addnode', node)
    }
  }
}
</script>
